﻿<html>

<head>

<!--COMMON :include style and javascript code-->
${inc:/action/pub/common}

<title>动迁档案管理</title>
<SCRIPT SRC="${def:context}/js/getResponse.js" LANGUAGE="JavaScript" TYPE="text/javascript">
</SCRIPT>
</head>

<body onmouseup="hidInputValidatorTip(3);">
<!--a name="A0" id="A0"></a-->

<!--COMMON HEADER-->
${inc:/action/pub/header}

<center>

<!--filter form-->
<div id="divFilter" style="display:none;width:100%">
</div>

<!--addnew/edit form-->
<div id="divEditor" style="display:none;width:100%">
</div>

<!--insert/update response-->
<div id="divEditorResponse" style="display:none;width:100%">
</div>

<!--grid view response-->
<div id="response" style="display:none;width:100%">
</div>

<!--progress indicator-->
<div id="divStatus" class="alert" style="text-align:left; display:none;color:gray;width:150px;font-weight:bold;font-family:Arial">
    <img src="${def:context}/images/progress.gif"> 请稍候...
</div>

<!--show linked grid-->
<iframe id="detail" name="detail" marginwidth="0" scrolling="no" frameborder="0" style="height:0%;width:100%;visibility:hidden">
</iframe>

<!--用于传递当前目录到header模版中-->
<input type="hidden" name="actionroot" id="actionroot" value="${def:actionroot}">

</center>

</body>

</html>

<script type="text/javascript">

var judge_flag = true;//是否校验楼源表
function getFlag(){
	return judge_flag;
}
function setFlag(val){
	judge_flag = val;
}

//字段校验
function checkFields(){
	//if(CheckNull("project_name","formEditor","请选择动迁项目")) return false;
	if(CheckNull("archives_no","formEditor")) return false;
	if(CheckNull("place_name","formEditor")) return false;
    if(CheckNull("master_name","formEditor")) return false;
	if(CheckNull("location_name1","formEditor","请选择小区名称")) return false;
	if(document.formEditor.house_tuid.value == "" && getFlag() == true){
		alert("请输入正确的楼号！");
		document.formEditor.house_name.focus();
		document.formEditor.house_name.select();
		return false;
	}
	//if(CheckNull("room_type","formEditor","请选择户型")) return false;
	if(!CheckFloatNum("jianzhu_area","formEditor")) return false;
	if(!CheckNum("population","formEditor")) return false;
    if(CheckNull("cun_name","formEditor")) return false;
	//if(!CheckRadio("archives_status","请选择档案状态","","formEditor")) return false;
    return true;
}

function validateMasterName(val){
	if(val == "")return false;
	var tuid = document.forms["formEditor"].elements["tuid"].value;
    var newFlag = (tuid==""?true:(tuid=="0"?true:false));
	if(newFlag == false)return false;
	return ajaxCall(httpMethod="GET", 
                        uri="/action/dq/yewu/liangfang/findMaster" + "?master_name=" + encodeURIComponent(val), 
                        divResponse="divEditorResponse",
                        divProgress="divStatus", 
                        formName=null, 
                        afterResponseFn=null, 
                        onErrorFn=showGrid);	
}

function searchBack(){
    document.getElementById("divFilter").style.display = "";
}

function addNewBackSetting(){
    document.getElementById("findHouseDiv").innerHTML = "";
	setReadWrite(document.formEditor.archives_no);
	setReadWrite(document.formEditor.master_name);
	setReadWrite(document.formEditor.house_name);
	setReadWrite(document.formEditor.jianzhu_area);
	setReadWrite(document.formEditor.population);
	//档案初始状态为待审核
	document.formEditor.archives_status.value = "0";
}

loadEditor();
loadFilter(showFilter);

//查找房源
function findHouse()
{
	if(getFlag() != true) return;
    var location_id = document.forms["formEditor"].location_id.value;
    var house_name  = document.forms["formEditor"].house_name.value;

    if (location_id == "" || location_id == null)
    {
        document.getElementById("findHouseDiv").innerHTML = "<font color='red'>请选择小区名称!</font>";
        return;
    }
    if (house_name == "" || house_name == null)
    {
        document.getElementById("findHouseDiv").innerHTML = "<font color='red'>请输入楼号!</font>";
        return;
    }

    document.getElementById("findHouseDiv").innerHTML = "";
    //楼号规则校验

    var uri="${def:context}${def:actionroot}/findhouse?id=" + location_id+"&house_name="+house_name;
    getResponse(uri);
}

//invoca la generacion de un PDF en un popup
function openPDF()
{
	var features = "height=500,width=800,status=no,toolbar=no,menubar=no,location=no,scrollbars=yes,resizable=yes";
	var url = "${def:context}${def:actionroot}/pdf?random=" + Math.random();
	var w = window.open(url, null, features);
}

//invoca la generacion de un Excel en un popup
function openExcel()
{
	var features = "height=500,width=800,status=no,toolbar=no,menubar=no,location=no,scrollbars=yes,resizable=yes";
	var url = "${def:context}${def:actionroot}/excel?random=" + Math.random();
	var w = window.open(url, null, features);
}

function windowOpenMy(url){
	var titleString = "dongqian";
	var ScWidth = screen.availwidth - 10;
	var ScHeight = screen.availheight - 48;
	var WindowOption = "location=no,menubar=yes,toolbar=no,scrollbars=yes,status=yes,resizable=yes,top=0,left=0";
	WindowOption = WindowOption + ",width=" + ScWidth;
	WindowOption = WindowOption + ",height=" + ScHeight;
	var newWin = window.open(url, titleString, WindowOption);
	newWin.focus();
}

function printLiangfangHandler(id){
	var url = "${def:context}/action/dq/yewu/liangfang/print?id="+id+"&random="+Math.random();
	windowOpenMy(url);
}

function printMasterDetailHandler(id){
	var url = "${def:context}/action/dq/master_detail/print?id="+id+"&random="+Math.random();
	windowOpenMy(url);
}

function printJiesuanHandler1(id){
	var url = "${def:context}${def:actionroot}/tabs/jiesuan/print?id="+id+"&random="+Math.random();
	windowOpenMy(url);
}

function printJiesuanHandler2(id){
	var url = "${def:context}/action/dq/yewu/jiesuan/pubshow/jiesuan/print?id="+id+"&random="+Math.random();
	windowOpenMy(url);
}

function writeSheshiJiesuan(id,archives_tuid){
	var url = "${def:context}${def:actionroot}/tabs?id="+id+"&archives_tuid="+archives_tuid + "&random="+Math.random();
	windowOpenMy(url);
}
</script>
    